//
//  KCView3.m
//  EmptyProjectDrawRect
//
//  Created by YannisChou on 16/3/25.
//  Copyright © 2016年 Alibaba. All rights reserved.
//

#import "KCView3.h"

@implementation KCView3

-(void)drawRect:(CGRect)rect{
    // 1.取得图形上下文
    CGContextRef context = UIGraphicsGetCurrentContext();
    [self drawRectWithContext:context];
}

#pragma mark 绘制矩形
-(void)drawRectWithContext:(CGContextRef)context{
    // 添加矩形对象
    CGRect rect = CGRectMake(20,25, 280.0, 50);
    CGContextAddRect(context, rect);
    // 设置属性
    [[UIColor blueColor] set];
    // 绘制
    CGContextDrawPath(context, kCGPathFillStroke);
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
